﻿@using BootstrapBlazor.Shared.Samples;
@inject IStringLocalizer<SweetAlerts> Localizer
@inject SwalService SwalService

<Button Icon="fa-solid fa-font-awesome" Text="@Localizer["SweetAlertsCloseButtonText"]" Color="Color.Success" OnClick="@ShowCloseSwal" />

@code {
    private async Task ShowCloseSwal()
    {
        var op = new SwalOption()
        {
            Category = SwalCategory.Error,
            Title = "Oops...",
            Content = "Something went wrong!",
            ShowClose = false
        };
        await SwalService.Show(op);
        await Task.Delay(4000);
        await op.CloseAsync();
    }
}
